package src.main.kotlin.day91

/**
 * 泛型类
 *  泛型类的构造函数可以接受任何类型
 *
 */

fun main() {

    val box1:MagicBox<boy> = MagicBox(boy("jack", 20))
    val box2:MagicBox<Dog> = MagicBox(Dog(30))

}

class MagicBox<T>(item:T){
    private var subject:T = item
}

class boy(val name: String,val age:Int)


class Dog(val weight:Int)

